These modifiers allow you to customize how SF Symbols are displayed and animated inside views, particularly with the Image
component.
symbolRenderingMode
Sets the rendering mode for symbol images within the view.
SymbolRenderingMode
)"monochrome"
– A single-color version using the foreground style"hierarchical"
– Multiple layers with different opacities for depth (good for semantic coloring)"multicolor"
– Uses the symbol's built-in colors"palette"
– Allows layered tinting (like using multiple foregroundStyle
layers)symbolRenderingMode="palette"
tells the system to render the symbol in multiple layered styles.foregroundStyle
now uses an object with primary
, secondary
, and optionally tertiary
layers to color those symbol layers individually.This matches SwiftUI's behavior with
.symbolRenderingMode(.palette)
and.foregroundStyle(primary, secondary, tertiary)
.
symbolVariant
Displays the symbol with a particular visual variant.
SymbolVariants
)"none"
– Default symbol with no variant"circle"
– Encapsulated in a circle"square"
– Encapsulated in a square"rectangle"
– Encapsulated in a rectangle"fill"
– Filled symbol"slash"
– Adds a slash over the symbol (often used to indicate "off" states)symbolEffect
Applies a symbol animation effect to the view. This can include transitions (appear/disappear), scale, bounce, rotation, breathing, pulsing, and wiggle effects. You can also bind the effect to a value so it animates when the value changes.
There are two forms of usage:
You can directly assign a symbol effect name:
These effects animate when the associated value changes.
In this example, each time isFavorited
changes, the bounce animation is triggered.
DiscreteSymbolEffect
)These effects can be bound to values:
Category | Effects |
---|---|
Bounce | bounce , bounceByLayer , bounceDown , bounceUp , bounceWholeSymbol |
Breathe | breathe , breatheByLayer , breathePlain , breathePulse , breatheWholeSymbol |
Pulse | pulse , pulseByLayer , pulseWholeSymbol |
Rotate | rotate , rotateByLayer , rotateClockwise , rotateCounterClockwise , rotateWholeSymbol |
VariableColor | variableColor , variableColorCumulative , variableColorDimInactiveLayers , variableColorHideInactiveLayers , variableColorIterative |
Wiggle | wiggle , wiggleByLayer , wiggleWholeSymbol , wiggleLeft , wiggleRight , wiggleUp , wiggleDown , wiggleForward , wiggleBackward , wiggleClockwise , wiggleCounterClockwise |
This image uses:
isNotified
stateModifier | Description |
---|---|
symbolRenderingMode |
Sets how SF Symbols are rendered (monochrome, multicolor, etc.) |
symbolVariant |
Applies a visual variant like fill , circle , or slash |
symbolEffect |
Adds visual animation effects; can be static or bound to a state change |